package com.lhn;

import com.lhn.config.SpringConfig;
import com.lhn.domain.Account;
import com.lhn.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

/**
 * @author lhn
 * @date 2024-08-20 12:01
 */

public class App14_1 {
    //不需要配置文件
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        AccountService accountService = (AccountService) ctx.getBean(AccountService.class);
        List<Account> accounts = accountService.findAll();
        System.out.println(accounts);

    }
}
